package com.miracle9.game.thread;

import com.miracle9.game.dao.LiKuiFishDeskDao;
import com.miracle9.game.entity.*;
import com.miracle9.game.service.*;
import com.miracle9.game.util.GameParameterAssist;
import com.miracle9.game.util.MyUtil;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;

@Service("onlineCountThread")
public class OnlineCountThread extends Thread {

    private Logger logger;
    @Autowired
    private FishDeskService fishDeskService;
    @Autowired
    private FishKingDeskService fishKingDeskServerce;
    @Autowired
    private LiKuiFishDeskService liKuiFishDeskService;
    @Autowired
    private GoldenCicadaFishDeskService goldenCicadaFishDeskService;
    @Autowired
    private TianGongDeskService tianGongDeskService;
    @Autowired
    private BcbmDeskService bcbmDeskService;
    @Autowired
    private GoldSharkDeskService goldSharkDeskService;
    @Autowired
    private DragonTigerDeskService dragonTigerDeskService;
    @Autowired
    private OnlineCountService onlineCountService;
    @Autowired
    private DeskService deskService;
    @Autowired
    private CardDeskService cardDeskService;
    @Autowired
    private UserService userService;
    @Autowired
    private BulletFishDeskService bulletFishDeskService;
    @Autowired
    private MermaidDeskService mermaidDeskService;
    @Autowired
    private LackDeskService lackDeskService;
    @Autowired
    private JoyDeskService joyDeskService;

    public OnlineCountThread() {
        this.logger = Logger.getLogger(OnlineCountThread.class);
    }

    @PostConstruct
    public void onlineCountThreadStart() {
        start();
    }

    public void run() {
        for (; ; ) {
            calendarMinute();
            try {
                Thread.sleep(50000L);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }

    public void calendarMinute() {
        try {
            Calendar calendar = Calendar.getInstance();
            int minute = calendar.get(12);
            if ((minute == 0) || (minute == 30)) {
                //addOnlineCountType_2();
                //addOnlineCountType_0();
                addOnlineCountType_1();
                Thread.sleep(1500000L);
            }
        } catch (Exception e) {
            this.logger.error("", e);
        }
    }

    private void addOnlineCountType_2() {
        int hallCount = GameParameterAssist.ba.size();
        int luckCount = GameParameterAssist.bh.size();
        int fishCount = GameParameterAssist.bi.size();
        int fishKingCount = GameParameterAssist.fishKingBi.size();
        int liKuiFishCount = GameParameterAssist.likuiFishUserId.size();
        int cardCount = GameParameterAssist.bj.size();
        int bulletCount = GameParameterAssist.bk.size();
        int mermaidCount = GameParameterAssist.bl.size();
        int lackCount = GameParameterAssist.aN.size();
        int joyCount = GameParameterAssist.aP.size();
        OnlineCount oc = new OnlineCount();
        oc.setDatetime(MyUtil.dateFormatYMD_HMS_Sting(new Date()));
        oc.setOnlineCount(hallCount + luckCount + fishCount + cardCount + bulletCount + mermaidCount + lackCount + joyCount + fishKingCount + liKuiFishCount);
        String detailStr = "大厅:" + hallCount;
        int expeRoomPeople = 0;
        int athleticsRoomPeople = 0;
        for (Map.Entry<Integer, List<User>> entry : GameParameterAssist.bm.entrySet()) {
            Desk desk = this.deskService.getDesk(((Integer) entry.getKey()).intValue());
            if (desk != null) {
                if (desk.getRoomId() == 1) {
                    expeRoomPeople += ((List) entry.getValue()).size();
                } else {
                    athleticsRoomPeople += ((List) entry.getValue()).size();
                }
            }
        }
        detailStr = String.valueOf(detailStr) + ";幸运六狮:" + luckCount + ",练习厅:" + expeRoomPeople + ",竞技厅:" + athleticsRoomPeople + ";";
        expeRoomPeople = 0;
        athleticsRoomPeople = 0;
        for (Map.Entry<Integer, List<User>> entry : GameParameterAssist.bn.entrySet()) {
            FishDesk desk2 = this.fishDeskService.getFishDesk(((Integer) entry.getKey()).intValue());
            if (desk2 != null) {
                if (desk2.getRoomId() == 1) {
                    expeRoomPeople += ((List) entry.getValue()).size();
                } else {
                    athleticsRoomPeople += ((List) entry.getValue()).size();
                }
            }
        }
        expeRoomPeople = 0;
        athleticsRoomPeople = 0;
        for (Map.Entry<Integer, List<User>> entry : GameParameterAssist.bo.entrySet()) {
            CardDesk desk3 = this.cardDeskService.getCardDesk(((Integer) entry.getKey()).intValue());
            if (desk3 != null) {
                if (desk3.getRoomId() == 1) {
                    expeRoomPeople += ((List) entry.getValue()).size();
                } else {
                    athleticsRoomPeople += ((List) entry.getValue()).size();
                }
            }
        }
        detailStr = String.valueOf(detailStr) + "单挑:" + cardCount + ",练习厅:" + expeRoomPeople + ",竞技厅:" + athleticsRoomPeople + ";";
        expeRoomPeople = 0;
        athleticsRoomPeople = 0;
        for (Map.Entry<Integer, List<User>> entry : GameParameterAssist.bp.entrySet()) {
            BulletFishDesk desk4 = this.bulletFishDeskService.getBulletDesk(((Integer) entry.getKey()).intValue());
            if (desk4 != null) {
                if (desk4.getRoomId() == 1) {
                    expeRoomPeople += ((List) entry.getValue()).size();
                } else {
                    athleticsRoomPeople += ((List) entry.getValue()).size();
                }
            }
        }
        detailStr = String.valueOf(detailStr) + "牛魔王:" + bulletCount + ",练习厅:" + expeRoomPeople + ",竞技厅:" + athleticsRoomPeople + ";";
        expeRoomPeople = 0;
        athleticsRoomPeople = 0;
        for (Map.Entry<Integer, List<User>> entry : GameParameterAssist.bq.entrySet()) {
            MermaidDesk desk5 = this.mermaidDeskService.getMermaidDesk(((Integer) entry.getKey()).intValue());
            if (desk5 != null) {
                if (desk5.getRoomId() == 1) {
                    expeRoomPeople += ((List) entry.getValue()).size();
                } else {
                    athleticsRoomPeople += ((List) entry.getValue()).size();
                }
            }
        }
        detailStr = String.valueOf(detailStr) + "QQ美人鱼:" + mermaidCount + ",练习厅:" + expeRoomPeople + ",竞技厅:" + athleticsRoomPeople + ";";
        expeRoomPeople = 0;
        athleticsRoomPeople = 0;
        for (Map.Entry<Integer, List<User>> entry : GameParameterAssist.aO.entrySet()) {
            LackDesk desk6 = this.lackDeskService.getLackDesk(((Integer) entry.getKey()).intValue());
            if (desk6 != null) {
                if (desk6.getRoomId() == 1) {
                    expeRoomPeople += ((List) entry.getValue()).size();
                } else {
                    athleticsRoomPeople += ((List) entry.getValue()).size();
                }
            }
        }
        detailStr = String.valueOf(detailStr) + "缺一门:" + lackCount + ",练习厅:" + expeRoomPeople + ",竞技厅:" + athleticsRoomPeople + ";";
        expeRoomPeople = 0;
        athleticsRoomPeople = 0;
        for (Map.Entry<Integer, List<User>> entry : GameParameterAssist.aQ.entrySet()) {
            JoyDesk desk7 = this.joyDeskService.getJoyDesk(((Integer) entry.getKey()).intValue());
            if (desk7 != null) {
                if (desk7.getRoomId() == 1) {
                    expeRoomPeople += ((List) entry.getValue()).size();
                } else {
                    athleticsRoomPeople += ((List) entry.getValue()).size();
                }
            }
        }
        detailStr = String.valueOf(detailStr) + "欢乐牛牛:" + lackCount + ",练习厅:" + expeRoomPeople + ",竞技厅:" + athleticsRoomPeople + ";";
        expeRoomPeople = 0;
        athleticsRoomPeople = 0;
        for (Map.Entry<Integer, List<User>> entry : GameParameterAssist.bn_king.entrySet()) {
            FishKingDesk desk7 = this.fishKingDeskServerce.getFishKingDesk(((Integer) entry.getKey()).intValue());
            if (desk7 != null) {
                if (desk7.getRoomId() == 1) {
                    expeRoomPeople += ((List) entry.getValue()).size();
                } else {
                    athleticsRoomPeople += ((List) entry.getValue()).size();
                }
            }
        }
        detailStr = String.valueOf(detailStr) + "海王2:" + fishKingCount + ",练习厅:" + expeRoomPeople + ",竞技厅:" + athleticsRoomPeople + ";";
        oc.setDetail(detailStr);
        oc.setType(2);
        this.onlineCountService.addOnlineCount(oc);
    }

    private void addOnlineCountType_0() {
        int hallCount = 0;
        int luckCount = 0;
        int fishCount = 0;
        int fishKingCount = 0;
        int liKuiFishCount = 0;
        int cardCount = 0;
        int bulletCount = 0;
        int mermaidCount = 0;
        int lackCount = 0;
        int joyCount = 0;
        for (Integer uid : GameParameterAssist.ba.keySet()) {
            User u = this.userService.getUser(uid.intValue());
            if ((u != null) && (u.getPromoterId() == 0)) {
                hallCount++;
            }
        }
        for (Integer uid : GameParameterAssist.bh.keySet()) {
            User u = this.userService.getUser(uid.intValue());
            if ((u != null) && (u.getPromoterId() == 0)) {
                luckCount++;
            }
        }
        for (Integer uid : GameParameterAssist.bi.keySet()) {
            User u = this.userService.getUser(uid.intValue());
            if ((u != null) && (u.getPromoterId() == 0)) {
                fishCount++;
            }
        }
        for (Integer uid : GameParameterAssist.fishKingBi.keySet()) {
            User u = this.userService.getUser(uid.intValue());
            if ((u != null) && (u.getPromoterId() == 0)) {
                fishKingCount++;
            }
        }
        for (Integer uid : GameParameterAssist.likuiFishUserId.keySet()) {
            User u = this.userService.getUser(uid.intValue());
            if ((u != null) && (u.getPromoterId() == 0)) {
                liKuiFishCount++;
            }
        }
        for (Integer uid : GameParameterAssist.bj.keySet()) {
            User u = this.userService.getUser(uid.intValue());
            if ((u != null) && (u.getPromoterId() == 0)) {
                cardCount++;
            }
        }
        for (Integer uid : GameParameterAssist.bk.keySet()) {
            User u = this.userService.getUser(uid.intValue());
            if ((u != null) && (u.getPromoterId() == 0)) {
                bulletCount++;
            }
        }
        for (Integer uid : GameParameterAssist.bl.keySet()) {
            User u = this.userService.getUser(uid.intValue());
            if ((u != null) && (u.getPromoterId() == 0)) {
                mermaidCount++;
            }
        }
        for (Integer uid : GameParameterAssist.aN.keySet()) {
            User u = this.userService.getUser(uid.intValue());
            if ((u != null) && (u.getPromoterId() == 0)) {
                lackCount++;
            }
        }
        for (Integer uid : GameParameterAssist.aP.keySet()) {
            User u = this.userService.getUser(uid.intValue());
            if ((u != null) && (u.getPromoterId() == 0)) {
                joyCount++;
            }
        }
        OnlineCount oc = new OnlineCount();
        oc.setDatetime(MyUtil.dateFormatYMD_HMS_Sting(new Date()));
        oc.setOnlineCount(hallCount + luckCount + fishCount + cardCount + bulletCount + mermaidCount + lackCount + joyCount + fishKingCount + liKuiFishCount);
        String detailStr = "大厅:" + hallCount;
        int expeRoomPeople = 0;
        int athleticsRoomPeople = 0;
        for (Map.Entry<Integer, List<User>> entry : GameParameterAssist.bm.entrySet()) {
            Desk desk = this.deskService.getDesk(((Integer) entry.getKey()).intValue());
            if (desk != null) {
                int tempCount = 0;
                for (User u2 : ((Entry<Integer, List<User>>) entry).getValue()) {
                    if (u2.getPromoterId() == 0) {
                        tempCount++;
                    }
                }
                if (desk.getRoomId() == 1) {
                    expeRoomPeople += tempCount;
                } else {
                    athleticsRoomPeople += tempCount;
                }
            }
        }
        detailStr = String.valueOf(detailStr) + ";幸运六狮:" + luckCount + ",练习厅:" + expeRoomPeople + ",竞技厅:" + athleticsRoomPeople + ";";
        expeRoomPeople = 0;
        athleticsRoomPeople = 0;
        for (Map.Entry<Integer, List<User>> entry : GameParameterAssist.bn.entrySet()) {
            FishDesk desk2 = this.fishDeskService.getFishDesk(((Integer) entry.getKey()).intValue());
            if (desk2 != null) {
                int tempCount = 0;
                for (User u2 : ((Entry<Integer, List<User>>) entry).getValue()) {
                    if (u2.getPromoterId() == 0) {
                        tempCount++;
                    }
                }
                if (desk2.getRoomId() == 1) {
                    expeRoomPeople += tempCount;
                } else {
                    athleticsRoomPeople += tempCount;
                }
            }
        }
        detailStr = String.valueOf(detailStr) + "捕鱼摇钱树:" + fishCount + ",练习厅:" + expeRoomPeople + ",竞技厅:" + athleticsRoomPeople + ";";
        expeRoomPeople = 0;
        athleticsRoomPeople = 0;
        for (Map.Entry<Integer, List<User>> entry : GameParameterAssist.bo.entrySet()) {
            CardDesk desk3 = this.cardDeskService.getCardDesk(((Integer) entry.getKey()).intValue());
            if (desk3 != null) {
                int tempCount = 0;
                for (User u2 : ((Entry<Integer, List<User>>) entry).getValue()) {
                    if (u2.getPromoterId() == 0) {
                        tempCount++;
                    }
                }
                if (desk3.getRoomId() == 1) {
                    expeRoomPeople += tempCount;
                } else {
                    athleticsRoomPeople += tempCount;
                }
            }
        }
        detailStr = String.valueOf(detailStr) + "单挑:" + cardCount + ",练习厅:" + expeRoomPeople + ",竞技厅:" + athleticsRoomPeople + ";";
        expeRoomPeople = 0;
        athleticsRoomPeople = 0;
        for (Map.Entry<Integer, List<User>> entry : GameParameterAssist.bp.entrySet()) {
            BulletFishDesk desk4 = this.bulletFishDeskService.getBulletDesk(((Integer) entry.getKey()).intValue());
            if (desk4 != null) {
                if (desk4.getRoomId() == 1) {
                    expeRoomPeople += ((List) entry.getValue()).size();
                } else {
                    athleticsRoomPeople += ((List) entry.getValue()).size();
                }
            }
        }
        detailStr = String.valueOf(detailStr) + "牛魔王:" + bulletCount + ",练习厅:" + expeRoomPeople + ",竞技厅:" + athleticsRoomPeople + ";";
        expeRoomPeople = 0;
        athleticsRoomPeople = 0;
        for (Map.Entry<Integer, List<User>> entry : GameParameterAssist.bq.entrySet()) {
            MermaidDesk desk5 = this.mermaidDeskService.getMermaidDesk(((Integer) entry.getKey()).intValue());
            if (desk5 != null) {
                if (desk5.getRoomId() == 1) {
                    expeRoomPeople += ((List) entry.getValue()).size();
                } else {
                    athleticsRoomPeople += ((List) entry.getValue()).size();
                }
            }
        }
        detailStr = String.valueOf(detailStr) + "QQ美人鱼:" + mermaidCount + ",练习厅:" + expeRoomPeople + ",竞技厅:" + athleticsRoomPeople + ";";
        expeRoomPeople = 0;
        athleticsRoomPeople = 0;
        for (Map.Entry<Integer, List<User>> entry : GameParameterAssist.aO.entrySet()) {
            LackDesk desk6 = this.lackDeskService.getLackDesk(((Integer) entry.getKey()).intValue());
            if (desk6 != null) {
                if (desk6.getRoomId() == 1) {
                    expeRoomPeople += ((List) entry.getValue()).size();
                } else {
                    athleticsRoomPeople += ((List) entry.getValue()).size();
                }
            }
        }
        detailStr = String.valueOf(detailStr) + "缺一门:" + lackCount + ",练习厅:" + expeRoomPeople + ",竞技厅:" + athleticsRoomPeople + ";";
        expeRoomPeople = 0;
        athleticsRoomPeople = 0;
        for (Map.Entry<Integer, List<User>> entry : GameParameterAssist.aQ.entrySet()) {
            JoyDesk desk7 = this.joyDeskService.getJoyDesk(((Integer) entry.getKey()).intValue());
            if (desk7 != null) {
                if (desk7.getRoomId() == 1) {
                    expeRoomPeople += ((List) entry.getValue()).size();
                } else {
                    athleticsRoomPeople += ((List) entry.getValue()).size();
                }
            }
        }
        detailStr = String.valueOf(detailStr) + "欢乐牛牛:" + lackCount + ",练习厅:" + expeRoomPeople + ",竞技厅:" + athleticsRoomPeople + ";";
        expeRoomPeople = 0;
        athleticsRoomPeople = 0;
        for (Map.Entry<Integer, List<User>> entry : GameParameterAssist.bn_king.entrySet()) {
            FishKingDesk desk7 = this.fishKingDeskServerce.getFishKingDesk(((Integer) entry.getKey()).intValue());
            if (desk7 != null) {
                if (desk7.getRoomId() == 1) {
                    expeRoomPeople += ((List) entry.getValue()).size();
                } else {
                    athleticsRoomPeople += ((List) entry.getValue()).size();
                }
            }
        }
        detailStr = String.valueOf(detailStr) + "海王2:" + fishKingCount + ",练习厅:" + expeRoomPeople + ",竞技厅:" + athleticsRoomPeople + ";";
        oc.setDetail(detailStr);
        oc.setType(0);
        this.onlineCountService.addOnlineCount(oc);
    }

    private void addOnlineCountType_1() {
        int hallCount = 0;
        int luckCount = 0;
        int fishCount = 0;
        int fishKingCount = 0;
        int liKuiFishCount = 0;
        int goldenFishCount = 0;
        int tianGongCount = 0;
        int bcbmCount = 0;
        int goldSharkCount = 0;
        int lhdCount = 0;
        int cardCount = 0;
        int bulletCount = 0;
        int mermaidCount = 0;
        int lackCount = 0;
        int joyCount = 0;
        for (Integer uid : GameParameterAssist.ba.keySet()) {
            User u = this.userService.getUser(uid.intValue());
            if ((u != null) && (u.getPromoterId() != 0)) {
                hallCount++;
            }
        }
        for (Integer uid : GameParameterAssist.bh.keySet()) {
            User u = this.userService.getUser(uid.intValue());
            if ((u != null) && (u.getPromoterId() != 0)) {
                luckCount++;
            }
        }
        for (Integer uid : GameParameterAssist.bi.keySet()) {
            User u = this.userService.getUser(uid.intValue());
            if ((u != null) && (u.getPromoterId() != 0)) {
                fishCount++;
            }
        }
        for (Integer uid : GameParameterAssist.fishKingBi.keySet()) {
            User u = this.userService.getUser(uid.intValue());
            if ((u != null) && (u.getPromoterId() != 0)) {
                fishKingCount++;
            }
        }
        for (Integer uid : GameParameterAssist.likuiFishUserId.keySet()) {
            User u = this.userService.getUser(uid.intValue());
            if ((u != null) && (u.getPromoterId() != 0)) {
                liKuiFishCount++;
            }
        }
        for (Integer uid : GameParameterAssist.goldenFishUserId.keySet()) {
            User u = this.userService.getUser(uid.intValue());
            if ((u != null) && (u.getPromoterId() != 0)) {
                goldenFishCount++;
            }
        }
        for (Integer uid : GameParameterAssist.tgUserId.keySet()) {
            User u = this.userService.getUser(uid.intValue());
            if ((u != null) && (u.getPromoterId() != 0)) {
                tianGongCount++;
            }
        }
        for (Integer uid : GameParameterAssist.goldSharkUserId.keySet()) {
            User u = this.userService.getUser(uid.intValue());
            if ((u != null) && (u.getPromoterId() != 0)) {
                goldSharkCount++;
            }
        }
        for (Integer uid : GameParameterAssist.lhdUserId.keySet()) {
            User u = this.userService.getUser(uid.intValue());
            if ((u != null) && (u.getPromoterId() != 0)) {
                lhdCount++;
            }
        }
        for (Integer uid : GameParameterAssist.bcbmUserId.keySet()) {
            User u = this.userService.getUser(uid.intValue());
            if ((u != null) && (u.getPromoterId() != 0)) {
                bcbmCount++;
            }
        }
        for (Integer uid : GameParameterAssist.bj.keySet()) {
            User u = this.userService.getUser(uid.intValue());
            if ((u != null) && (u.getPromoterId() != 0)) {
                cardCount++;
            }
        }
        for (Integer uid : GameParameterAssist.bk.keySet()) {
            User u = this.userService.getUser(uid.intValue());
            if ((u != null) && (u.getPromoterId() != 0)) {
                bulletCount++;
            }
        }
        for (Integer uid : GameParameterAssist.bl.keySet()) {
            User u = this.userService.getUser(uid.intValue());
            if ((u != null) && (u.getPromoterId() != 0)) {
                mermaidCount++;
            }
        }
        for (Integer uid : GameParameterAssist.aN.keySet()) {
            User u = this.userService.getUser(uid.intValue());
            if ((u != null) && (u.getPromoterId() != 0)) {
                lackCount++;
            }
        }
        for (Integer uid : GameParameterAssist.aP.keySet()) {
            User u = this.userService.getUser(uid.intValue());
            if ((u != null) && (u.getPromoterId() != 0)) {
                joyCount++;
            }
        }
        OnlineCount oc = new OnlineCount();
        oc.setDatetime(MyUtil.dateFormatYMD_HMS_Sting(new Date()));
        oc.setOnlineCount(hallCount + luckCount + fishCount + cardCount + bulletCount + mermaidCount + lackCount + joyCount + fishKingCount + liKuiFishCount + goldenFishCount + tianGongCount + bcbmCount + goldSharkCount + lhdCount);
        String detailStr = "大厅:" + hallCount;
        int expeRoomPeople = 0;
        int athleticsRoomPeople = 0;
        for (Map.Entry<Integer, List<User>> entry : GameParameterAssist.bm.entrySet()) {
            Desk desk = this.deskService.getDesk(((Integer) entry.getKey()).intValue());
            if (desk != null) {
                int tempCount = 0;
                for (User u2 : ((Entry<Integer, List<User>>) entry).getValue()) {
                    if (u2.getPromoterId() != 0) {
                        tempCount++;
                    }
                }
                if (desk.getRoomId() == 1) {
                    expeRoomPeople += tempCount;
                } else {
                    athleticsRoomPeople += tempCount;
                }
            }
        }
        detailStr = String.valueOf(detailStr) + ";幸运六狮:" + luckCount + ",练习厅:" + expeRoomPeople + ",竞技厅:" + athleticsRoomPeople + ";";
        expeRoomPeople = 0;
        athleticsRoomPeople = 0;
        for (Map.Entry<Integer, List<User>> entry : GameParameterAssist.bn.entrySet()) {
            FishDesk desk2 = this.fishDeskService.getFishDesk(((Integer) entry.getKey()).intValue());
            if (desk2 != null) {
                int tempCount = 0;
                for (User u2 : ((Entry<Integer, List<User>>) entry).getValue()) {
                    if (u2.getPromoterId() != 0) {
                        tempCount++;
                    }
                }
                if (desk2.getRoomId() == 1) {
                    expeRoomPeople += tempCount;
                } else {
                    athleticsRoomPeople += tempCount;
                }
            }
        }
        detailStr = String.valueOf(detailStr) + "捕鱼摇钱树:" + fishCount + ",练习厅:" + expeRoomPeople + ",竞技厅:" + athleticsRoomPeople + ";";
        expeRoomPeople = 0;
        athleticsRoomPeople = 0;
        for (Map.Entry<Integer, List<User>> entry : GameParameterAssist.bo.entrySet()) {
            CardDesk desk3 = this.cardDeskService.getCardDesk(((Integer) entry.getKey()).intValue());
            if (desk3 != null) {
                int tempCount = 0;
                for (User u2 : ((Entry<Integer, List<User>>) entry).getValue()) {
                    if (u2.getPromoterId() != 0) {
                        tempCount++;
                    }
                }
                if (desk3.getRoomId() == 1) {
                    expeRoomPeople += tempCount;
                } else {
                    athleticsRoomPeople += tempCount;
                }
            }
        }
        detailStr = String.valueOf(detailStr) + "单挑:" + cardCount + ",练习厅:" + expeRoomPeople + ",竞技厅:" + athleticsRoomPeople + ";";
        expeRoomPeople = 0;
        athleticsRoomPeople = 0;
        for (Map.Entry<Integer, List<User>> entry : GameParameterAssist.bp.entrySet()) {
            BulletFishDesk desk4 = this.bulletFishDeskService.getBulletDesk(((Integer) entry.getKey()).intValue());
            if (desk4 != null) {
                if (desk4.getRoomId() == 1) {
                    expeRoomPeople += ((List) entry.getValue()).size();
                } else {
                    athleticsRoomPeople += ((List) entry.getValue()).size();
                }
            }
        }
        detailStr = String.valueOf(detailStr) + "牛魔王:" + bulletCount + ",练习厅:" + expeRoomPeople + ",竞技厅:" + athleticsRoomPeople + ";";
        expeRoomPeople = 0;
        athleticsRoomPeople = 0;
        for (Map.Entry<Integer, List<User>> entry : GameParameterAssist.bq.entrySet()) {
            MermaidDesk desk5 = this.mermaidDeskService.getMermaidDesk(((Integer) entry.getKey()).intValue());
            if (desk5 != null) {
                if (desk5.getRoomId() == 1) {
                    expeRoomPeople += ((List) entry.getValue()).size();
                } else {
                    athleticsRoomPeople += ((List) entry.getValue()).size();
                }
            }
        }
        detailStr = String.valueOf(detailStr) + "QQ美人鱼:" + mermaidCount + ",练习厅:" + expeRoomPeople + ",竞技厅:" + athleticsRoomPeople + ";";
        expeRoomPeople = 0;
        athleticsRoomPeople = 0;
        for (Map.Entry<Integer, List<User>> entry : GameParameterAssist.aO.entrySet()) {
            LackDesk desk6 = this.lackDeskService.getLackDesk(((Integer) entry.getKey()).intValue());
            if (desk6 != null) {
                if (desk6.getRoomId() == 1) {
                    expeRoomPeople += ((List) entry.getValue()).size();
                } else {
                    athleticsRoomPeople += ((List) entry.getValue()).size();
                }
            }
        }
        detailStr = String.valueOf(detailStr) + "缺一门:" + lackCount + ",练习厅:" + expeRoomPeople + ",竞技厅:" + athleticsRoomPeople + ";";
        expeRoomPeople = 0;
        athleticsRoomPeople = 0;
        for (Map.Entry<Integer, List<User>> entry : GameParameterAssist.aQ.entrySet()) {
            JoyDesk desk7 = this.joyDeskService.getJoyDesk(((Integer) entry.getKey()).intValue());
            if (desk7 != null) {
                if (desk7.getRoomId() == 1) {
                    expeRoomPeople += ((List) entry.getValue()).size();
                } else {
                    athleticsRoomPeople += ((List) entry.getValue()).size();
                }
            }
        }
        detailStr = String.valueOf(detailStr) + "欢乐牛牛:" + joyCount + ",练习厅:" + expeRoomPeople + ",竞技厅:" + athleticsRoomPeople + ";";
        expeRoomPeople = 0;
        athleticsRoomPeople = 0;
        for (Map.Entry<Integer, List<User>> entry : GameParameterAssist.bn_king.entrySet()) {
            FishKingDesk desk7 = this.fishKingDeskServerce.getFishKingDesk(((Integer) entry.getKey()).intValue());
            if (desk7 != null) {
                if (desk7.getRoomId() == 1) {
                    expeRoomPeople += ((List) entry.getValue()).size();
                } else {
                    athleticsRoomPeople += ((List) entry.getValue()).size();
                }
            }
        }
        detailStr = String.valueOf(detailStr) + "海王2:" + fishKingCount + ",练习厅:" + expeRoomPeople + ",竞技厅:" + athleticsRoomPeople + ";";
        expeRoomPeople = 0;
        athleticsRoomPeople = 0;
        for (Map.Entry<Integer, List<User>> entry : GameParameterAssist.likuiFishUserList.entrySet()) {
            LiKuiFishDesk desk7 = this.liKuiFishDeskService.getLiKuiFishDesk(entry.getKey());
            if (desk7 != null) {
                if (desk7.getRoomId() == 1) {
                    expeRoomPeople += ((List) entry.getValue()).size();
                } else {
                    athleticsRoomPeople += ((List) entry.getValue()).size();
                }
            }
        }
        detailStr = String.valueOf(detailStr) + "李逵劈鱼:" + liKuiFishCount + ",练习厅:" + expeRoomPeople + ",竞技厅:" + athleticsRoomPeople + ";";
        expeRoomPeople = 0;
        athleticsRoomPeople = 0;
        for (Map.Entry<Integer, List<User>> entry : GameParameterAssist.goldenFishUserList.entrySet()) {
            GoldenCicadaFishDesk desk7 = this.goldenCicadaFishDeskService.getGoldenCicadaFishDesk((entry.getKey()).intValue());
            if (desk7 != null) {
                if (desk7.getRoomId() == 1) {
                    expeRoomPeople += ((List) entry.getValue()).size();
                } else {
                    athleticsRoomPeople += ((List) entry.getValue()).size();
                }
            }
        }
        detailStr = String.valueOf(detailStr) + "金蟾捕鱼:" + goldenFishCount + ",练习厅:" + expeRoomPeople + ",竞技厅:" + athleticsRoomPeople + ";";
        expeRoomPeople = 0;
        athleticsRoomPeople = 0;
        for (Map.Entry<Integer, List<User>> entry : GameParameterAssist.tgUserList.entrySet()) {
            TianGongDesk desk7 = this.tianGongDeskService.getTianGongDesk((entry.getKey()));
            if (desk7 != null) {
                if (desk7.getRoomId() == 1) {
                    expeRoomPeople += ((List) entry.getValue()).size();
                } else {
                    athleticsRoomPeople += ((List) entry.getValue()).size();
                }
            }
        }
        detailStr = String.valueOf(detailStr) + "大闹天宫:" + tianGongCount + ",练习厅:" + expeRoomPeople + ",竞技厅:" + athleticsRoomPeople + ";";
        expeRoomPeople = 0;
        athleticsRoomPeople = 0;
        for (Map.Entry<Integer, List<User>> entry : GameParameterAssist.bcbmUserList.entrySet()) {
            BcbmDesk desk7 = this.bcbmDeskService.getBcbmDesk((entry.getKey()));
            if (desk7 != null) {
                if (desk7.getRoomId() == 1) {
                    expeRoomPeople += ((List) entry.getValue()).size();
                } else {
                    athleticsRoomPeople += ((List) entry.getValue()).size();
                }
            }
        }
        detailStr = String.valueOf(detailStr) + "奔驰宝马:" + bcbmCount + ",练习厅:" + expeRoomPeople + ",竞技厅:" + athleticsRoomPeople + ";";
        expeRoomPeople = 0;
        athleticsRoomPeople = 0;
        for (Map.Entry<Integer, List<User>> entry : GameParameterAssist.goldSharkUserList.entrySet()) {
            GoldSharkDesk desk = this.goldSharkDeskService.getDesk((entry.getKey()));
            if (desk != null) {
                if (desk.getRoomId() == 1) {
                    expeRoomPeople += entry.getValue().size();
                } else {
                    athleticsRoomPeople += entry.getValue().size();
                }
            }
        }
        detailStr = String.valueOf(detailStr) + "金鲨银鲨:" + goldSharkCount + ",练习厅:" + expeRoomPeople + ",竞技厅:" + athleticsRoomPeople + ";";
        expeRoomPeople = 0;
        athleticsRoomPeople = 0;
        for (Map.Entry<Integer, List<User>> entry : GameParameterAssist.lhdUserList.entrySet()) {
            DragonTigerDesk desk = this.dragonTigerDeskService.getDesk((entry.getKey()));
            if (desk != null) {
                if (desk.getRoomId() == 1) {
                    expeRoomPeople += entry.getValue().size();
                } else {
                    athleticsRoomPeople += entry.getValue().size();
                }
            }
        }
        detailStr = String.valueOf(detailStr) + "龙虎斗:" + lhdCount + ",练习厅:" + expeRoomPeople + ",竞技厅:" + athleticsRoomPeople + ";";

        oc.setDetail(detailStr);
        oc.setType(1);
        this.onlineCountService.addOnlineCount(oc);
    }

}
